<!DOCTYPE html>
<html>
    
    <head>
        <meta charset="utf-8">
        <title>
            阳光成单系统
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="./css/x-admin.css" media="all">
    </head>
    
    <body>
        <div class="x-body">
            <form class="layui-form" onsubmit="return false" id="form_xiyangyangchaoshi">
                <div class="layui-form-item">
                    <label for="username" class="layui-form-label">
                        <span class="x-red">*</span>id
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="id" name="id" readonly=""
                        autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                       
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="username" class="layui-form-label">
                        <span class="x-red">*</span>超市名称
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="chaoShiName" name="chaoShiName" required="" lay-verify="required"
                        autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <label for="username" class="layui-form-label">
                        <span class="x-red">*</span>超市介绍
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="chaoShiJieShao" name="chaoShiJieShao" required="" lay-verify="required" 
                        autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                       
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="phone" class="layui-form-label">
                        <span class="x-red">*</span>超市电话
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="chaoShiDianHua" name="chaoShiDianHua" required="" 
                        autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                       
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_email" class="layui-form-label">
                        <span class="x-red">*</span>超市邮箱
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="chaoShiYouXiang" name="chaoShiYouXiang"
                        autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        
                    </div>
                </div>
               
               <div class="layui-form-item">
                    <label for="username" class="layui-form-label">
                        <span class="x-red">*</span>超市网址
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="chaoShiWangZhi" name="chaoShiWangZhi"  
                        autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                    </div>
                </div>
               
                <div class="layui-form-item">
                    <label for="L_pass" class="layui-form-label">
                        <span class="x-red">*</span>超市地址
                    </label>
                    <div class="layui-input-inline">
                        <input id="chaoShiDiZhi" name="chaoShiDiZhi"
                        autocomplete="off" class="layui-input">
                    </div>
                   
                </div>
                <div class="layui-form-item">
                    <label for="L_repass" class="layui-form-label">
                        <span class="x-red">*</span>企业文化
                    </label>
                    <div class="layui-input-inline">
                        <input id="qiYeWenHua" name="qiYeWenHua" 
                        autocomplete="off" class="layui-input">
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <label for="username" class="layui-form-label">
                        <span class="x-red">*</span>超市详介
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="chaoShiXiangJie" name="chaoShiXiangJie" 
                        autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <label for="username" class="layui-form-label">
                        <span class="x-red">*</span>超市二维码
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="chaoShiErWeiMa" name="chaoShiErWeiMa" 
                        autocomplete="off" class="layui-input">
                        <img width="200px" alt="" src="../" id="img_chaoShiErWeiMa">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <label for="username" class="layui-form-label">
                        <span class="x-red">*</span>logo
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="logo" name="logo" 
                        autocomplete="off" class="layui-input">
                        <img width="200px" alt="" src="../" id="img_logo">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_repass" class="layui-form-label">
                    </label>
                    <button  class="layui-btn" lay-filter="save"onclick="editXiYangYangChaoShiById()">
                        保存
                    </button>
                </div>
            </form>
        </div>
        <script src="./lib/layui/layui.js" charset="utf-8">
        </script>
        <script src="./js/x-layui.js" charset="utf-8">
        </script>
        <script>
        var $ =null;
        var form=null;
        var layer =null;
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              form = layui.form;
              layer = layui.layer;
            
             
             $(function(){
            	 getXiYangYangChaoShiById();
             })
              });

            
        
            
            function getXiYangYangChaoShiById(){
           	 $.post("../AdminXiYangYangChao?reqName=getXiYangYangChaoShiById",{
           		 id:sessionStorage.getItem("id")
           	 },function(res){
           		 $("#chaoShiName").val(res.chaoShiName);
           		 $("#logo").val(res.logo);
           		 
           		 $("#chaoShiJieShao").val(res.chaoShiJieShao);
           		 $("#chaoShiDianHua").val(res.chaoShiDianHua);
           		 $("#chaoShiYouXiang").val(res.chaoShiYouXiang);
           		 $("#chaoShiWangZhi").val(res.chaoShiWangZhi);
           		 $("#chaoShiDiZhi").val(res.chaoShiDiZhi);
           		 $("#qiYeWenHua").val(res.qiYeWenHua);
           		 $("#chaoShiXiangJie").val(res.chaoShiXiangJie);
           		 $("#chaoShiErWeiMa").val(res.chaoShiErWeiMa);
           		 $("#id").val(res.id);
           		 $("#img_logo").attr("src",res.logo);
           		 $("#img_chaoShiErWeiMa").attr("src",res.chaoShiErWeiMa);
           	 },"json")
            }
            
            
            function editXiYangYangChaoShiById(){
            	$.post("../AdminXiYangYangChao?reqName=editXiYangYangChaoShiById",$("#form_xiyangyangchaoshi").serialize(),function(res){
           			if(res.success){
           				layer.msg("修改成功",{
           					icon:1,
           					time:2000
           				})
           				var index = parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);//关闭当前页
						parent.selXinWenXiangQingByPage();
           			}else{
           				layer.msg("修改成功",{
           					icon:1,
           					time:2000
           				})
           			}	
            		
            		
            		
            	},"json")
            }
        </script>
        
    </body>

</html>